﻿@{
   
    Layout = "~/Views/Shared/_LayoutVideo.cshtml";
}
<input type="hidden" id="hdncul" value="@Session["Culture"]" />
<input type="hidden" id="hdnpageVideo" />

<script type="text/javascript">
    $().ready(function () {
        $("#hdnpageVideo").val(1);
    });

    function LoadDataRecord() {
        $('div#loading').html('<p><img src="/Images/Design/loading.gif" style="width:100%; height:25px;position:relative;"></p>');
       
        $.ajax({
            type: 'Get',
            url: '@Url.Action("GetVideooDataContract", "Home")',
            data: { page: parseInt($("#hdnpageVideo").val()) + 1 },
            async: true,
            dataType: "html",
            success: function (data) {
                if (data != '') {
                    $("#videoAll").append(data);
                    $("#hdnpageVideo").val(parseInt($("#hdnpageVideo").val()) + 1);
                }
                
            },
            error: function (xhr, ajaxOptions, thrownError) {
                //alert(xhr.status);
                //alert(thrownError);
            }
        });
        $('div#loading').empty();
    }
   
    $(window).scroll(function () {
        if ($(window).scrollTop() == $(document).height() - $(window).height()) {

            LoadDataRecord();
        }
    });
</script>

<div class="video-frame">
    <div id="videoAll" >
        @Html.Partial("VideoPartial")
    </div>
    <div id="loading"></div>
</div>